﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Pseudogenerator.Common.Generators.Core;

namespace Pseudogenerator.Common.Generators
{
    public class OneSetMix
        : Mix
    {

        public override bool CanGenerateNext
        {
            get { return m > k && k > 16; }
        }

        public override uint GetNextValue()
        {
            throw new NotImplementedException();
        }

        public override List<RandomNumber> GetFullList()
        {
            var nums = new List<RandomNumber>();
            if (CanGenerateNext)
            {
                var numsGreen = new List<RandomNumber>(Serie1.GetFullList());

                var vector = new List<RandomNumber>();
                for (int i = 0; i < k; i++)
                {
                    vector.Add(numsGreen[i]);
                }
                for (int i = 0; i < m; i++)
                {
                    int j = (int)(k * numsGreen[i].Uniform);
                    nums.Add(new RandomNumber(m) { n = (uint)i, Xn = numsGreen[j].Xn });
                }
            }
            return nums;
        }

        public override string ToString()
        {
            return string.Format("k = {0}, m = {1}", k, m);
        }
    }
}
